package com.bauer.springboot.consumerfeign;

import com.bauer.springboot.consumerfeign.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@RestController
@EnableHystrixDashboard
@EnableCircuitBreaker
public class FeignApp {

    @Autowired
    private HelloService helloService;

    public static void main(String[] args) {
        SpringApplication.run(FeignApp.class, args);
    }

    @RequestMapping("/hi")
    public String hello(){
        return helloService.sayHi("bauer");
    }
}
